package com.fz.mapper;

import com.fz.entity.Book;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by webrx on 2017-09-11.
 */
public interface BookMapper {
    @Select("select * from db_book where id=#{id}")
    public Book queryById(int id);


    @Delete("delete from db_book where id=#{id}")
    public int deleteById(int id);

    @Select("select * from db_book")
    public List<Book> queryAll();

    @Insert("insert into db_book values(null,#{name},#{price},#{bdate})")
    public int save(Book book);

    public List<Map<String,Object>> query();
}
